package org.excelapi.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;

@Data
@EqualsAndHashCode
@HeadRowHeight(20) //行高
@ColumnWidth(15) //列宽度
public class DemoData {
    @ExcelProperty( "字符串标题")
    private String title;

    @DateTimeFormat("yyyy年MM月dd日 HH:mm:ss") //格式化日期
    @ExcelProperty("日期标题")
    @ColumnWidth(30) //列宽度
    private Date dateTime;

    @NumberFormat("#.##") //数字格式
    @ExcelProperty("数字标题")
    private Double numberData;
    /**
     * 忽略这个字段
     */
    @ExcelIgnore
    private String ignore;
}
